﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<script name="name" type="text/javascript" src="/static/js/image-file-visible.js"></script>
<script name="name" type="text/javascript" src="/static/js/jquery.form.js"></script>
<script name="name" type="text/javascript">
	$(function(){
		$("#mobile").blur(function(){
			var mobileNo = $("#mobile").val();
			if(mobileNo == null || mobileNo == ''){
				return;
			}
			$.post("${basePath}/user/isMobileUniq",{mobile:mobileNo,userId:'${user.id}'},function(data){
				if(data.code==200){
					return;
				}else{
					$("#mobile").val("");
					$("#mobile").focus();
					alert("手机号已存在");
				}
			});
		});
		$.imageFileVisible({
			wrapSelector: "#pic",
			fileSelector: "#pictureFile",
			formSelector: "#updateUserForm",
			width: 100,
			height: 50
		});
		loadContactInfo();
	});
	
	function clp(){
		return $("#pictureFile").click();
	}
	
	function loadContactInfo(){
		if('${user.sex}' == "男"){
			$("input[name='sex']").eq(0).attr("checked","checked");
		}else{
			$("input[name='sex']").eq(1).attr("checked","checked");
		}
		var picPath = '${user.picture}';
		if(picPath != null && picPath != ''){
			$("#pic").attr("src",'/common/getPic?path=${user.picture}');
		}
	}
</script>
<div class="col-md-12 column">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<h3 class="text-center">联系方式（以下信息不公开，仅作存档以及今后牵线联络）</h3>
		</div>
	</div>
	<div class="row clearfix">
		<div class="form-group col-md-6 column">
			<label for="pic" class="col-sm-2 control-label">个人照片</label>
			<div class="col-sm-10">
				<img id="pic" name="pic" onclick = "clp();" style="margin-top:10px;Cursor:pointer;width: 350px;height:300px;" src="/static/image/null.jpg">
				<input id="pictureFile" name="pictureFile" style="visibility: hidden;" type="file" class="form-control" />
				<input id="picture" name="picture" value="${user.picture}" type="hidden" class="form-control" />
			</div>
		</div>
		<div class="col-md-6 column">
			<div class="form-group">
				<label for="name" class="col-sm-2 control-label">真实姓名</label>
				<div class="col-sm-10">
					<input value="${user.name}" style="float:left;width:20%" class="form-control" id="name" name="name" type="text" />
					<label style="float:left;width:15%" for="sex" class="col-sm-2 control-label">性别</label>
					<input style="float:left;width:5%" class="form-control" name="sex" type="radio" value="男" />
					<span style="float:left;margin-top: 10px;">男</span>
					<input style="float:left;width:5%;margin-left:20px;" class="form-control" name="sex" type="radio" value="女" />
					<span style="float:left;margin-top: 10px;">女</span>
				</div>
			</div>
			<div class="form-group">
				<label for="mobile" class="col-sm-2 control-label">移动电话</label>
				<div class="col-sm-10">
					<input value="${user.mobile}" style="float: left; width: 120px;" class="form-control" id="mobile" name="mobile" type="text" />
					<label style="float:left;width:20%" for="sex" class="col-sm-2 control-label">号码所属</label>
					<input value="${user.mobileBelongsTo}" style="float:left;width:20%" class="form-control" id="mobileBelongsTo" name="mobileBelongsTo" type="text" />
				</div>
			</div>
			<div class="form-group">
				<label for="address" class="col-sm-2 control-label">通讯地址</label>
				<div class="col-sm-10">
					<input value="${user.address}" class="form-control" id="address" name="address" type="text" />
				</div>
			</div>
			<div class="form-group">
				<label for="qq" class="col-sm-2 control-label">QQ/MSN</label>
				<div class="col-sm-10">
					<input value="${user.qq}" class="form-control" id="qq" name="qq" type="text" />
				</div>
			</div>
			<div class="form-group">
				<label for="email" class="col-sm-2 control-label">电子邮箱</label>
				<div class="col-sm-10">
					<input value="${user.email}" class="form-control" id="email" name="email" type="text" />
				</div>
			</div>
			<div class="form-group">
				<label for="idCardNum" class="col-sm-2 control-label">身份证号</label>
				<div class="col-sm-10">
					<input value="${user.idCardNum}" class="form-control" id="idCardNum" name="idCardNum" type="text" />
				</div>
			</div>
		</div>
	</div>
</div>